import 'package:enterprise_v6_app/app/components/custom_modele/custom_dropdown_selection.dart';
import 'package:enterprise_v6_app/app/components/custom_refresh.dart';
import 'package:enterprise_v6_app/app/core/core.dart';
import 'package:enterprise_v6_app/app/data/entities/application/standardiztion/standardization_entity.dart';
import 'package:enterprise_v6_app/app/modules/application/standardization/common.dart';
import 'package:enterprise_v6_app/app/modules/application/standardization/pages/scence/alarm/ctrl.dart';

/// 警示标志
class StandardizationScenceAlarmView extends StatelessWidget {
  StandardizationScenceAlarmView({super.key});

  final ctrl = Get.put(StandardizationScenceAlarmController());

  @override
  Widget build(BuildContext context) {
    return GetBuilder(
      init: ctrl,
      builder: (_) {
        return Column(
          children: [
            CustomDropdownSelection(
              text: ctrl.type.name,
              onCallBack: ctrl.showSelect,
              height: 37.w,
            ),
            AppGaps.vGap10,
            Expanded(child: _buildBody()),
          ],
        );
      },
    );
  }

  Widget _buildBody() {
    return CustomEasyRefreshList<StandardizationEntity>(
      key: ValueKey(ctrl.type),
      isShowSearch: true,
      dataLoad: ctrl.getPages,
      itemBuilder: StandardizationCommon.card,
    );
  }
}